﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class SearchTour : System.Web.UI.UserControl
{
    eStoreDataContext db = new eStoreDataContext();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
           //  load Category cho from edit products
            ddldiemden.DataSource = db.Locations;
            ddldiemden.DataValueField = "LocationId";
            ddldiemden.DataTextField = "Name";
            ddldiemden.DataBind();
        }
    }
    protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (RadioButtonList1.SelectedIndex == 0)
        {
            //  load Category cho from edit products
            ddldiemden.DataSource = db.Locations;
            ddldiemden.DataValueField = "LocationId";
            ddldiemden.DataTextField = "Name";
            ddldiemden.DataBind();
        }
        else {
            ddldiemden.DataSource = db.Categories;
            ddldiemden.DataValueField = "CategoryId";
            ddldiemden.DataTextField = "Name";
            ddldiemden.DataBind();
        }
    }
}